﻿//using System.Reflection;
//using System.ServiceModel.Channels;
//using System.ServiceModel.Description;
//using System.ServiceModel.Dispatcher;

//namespace EasyComm.Hosting.Configuration
//{
//    public class ServiceOperationBehavior : IOperationBehavior
//    {
//        private MethodInfo _methodInfo;

//        private IOperationBehavior _innerBehavior;


//        internal ServiceOperationBehavior(MethodInfo methodInfo)
//        {
//            this._methodInfo = methodInfo;
//        }

//        #region IOperationBehavior Members

//        public void AddBindingParameters(
//            OperationDescription operationDescription, BindingParameterCollection bindingParameters)
//        {
//        }

//        public void ApplyClientBehavior(OperationDescription operationDescription,
//            ClientOperation clientOperation)
//        {
//        }

//        public void ApplyDispatchBehavior(OperationDescription operationDescription,
//            DispatchOperation dispatchOperation)
//        {
//            if (null == this._innerBehavior)
//            {
//                this._innerBehavior =
//                    new DataContractSerializerOperationBehavior(operationDescription) as IOperationBehavior;
//            }

//            this._innerBehavior.ApplyDispatchBehavior(operationDescription, dispatchOperation);

//            dispatchOperation.DeserializeRequest = true;
//            dispatchOperation.SerializeReply = true;

//            dispatchOperation.Invoker = new ServiceInvoker(this._methodInfo);
//        }

//        public void Validate(OperationDescription operationDescription)
//        {
//        }

//        #endregion
//    }
//}
